3.154 \(\int \csc ^2(e+f x) (a+b \sin (e+f x)) \, dx\)

Optimal. Leaf size=26 \[ -\frac {a \cot (e+f x)}{f}-\frac {b \tanh ^{-1}(\cos (e+f x))}{f} \]

[Out]

-b*arctanh(cos(f*x+e))/f-a*cot(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {2748, 3767, 8, 3770} \[ -\frac {a \cot (e+f x)}{f}-\frac {b \tanh ^{-1}(\cos (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^2*(a + b*Sin[e + f*x]),x]

[Out]

-((b*ArcTanh[Cos[e + f*x]])/f) - (a*Cot[e + f*x])/f

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2748

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \csc ^2(e+f x) (a+b \sin (e+f x)) \, dx &=a \int \csc ^2(e+f x) \, dx+b \int \csc (e+f x) \, dx\\ &=-\frac {b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a \operatorname {Subst}(\int 1 \, dx,x,\cot (e+f x))}{f}\\ &=-\frac {b \tanh ^{-1}(\cos (e+f x))}{f}-\frac {a \cot (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 52, normalized size = 2.00 \[ -\frac {a \cot (e+f x)}{f}+\frac {b \log \left (\sin \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{f}-\frac {b \log \left (\cos \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^2*(a + b*Sin[e + f*x]),x]

[Out]

-((a*Cot[e + f*x])/f) - (b*Log[Cos[e/2 + (f*x)/2]])/f + (b*Log[Sin[e/2 + (f*x)/2]])/f

________________________________________________________________________________________

fricas [B]  time = 0.49, size = 62, normalized size = 2.38 \[ -\frac {b \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) - b \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) + 2 \, a \cos \left (f x + e\right )}{2 \, f \sin \left (f x + e\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*sin(f*x+e)),x, algorithm="fricas")

[Out]

-1/2*(b*log(1/2*cos(f*x + e) + 1/2)*sin(f*x + e) - b*log(-1/2*cos(f*x + e) + 1/2)*sin(f*x + e) + 2*a*cos(f*x +
 e))/(f*sin(f*x + e))

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*sin(f*x+e)),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)2/f*(tan((f*x+exp(1))/2)*a/4+(-2*tan((f*x+exp(1))/2)*b-a)*1/4/tan((f*x+exp(1))/2)+b/2*ln(abs(tan((f*x+exp(
1))/2))))

________________________________________________________________________________________

maple [A]  time = 0.17, size = 35, normalized size = 1.35 \[ -\frac {a \cot \left (f x +e \right )}{f}+\frac {b \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^2*(a+b*sin(f*x+e)),x)

[Out]

-a*cot(f*x+e)/f+1/f*b*ln(csc(f*x+e)-cot(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.61, size = 40, normalized size = 1.54 \[ -\frac {b {\left (\log \left (\cos \left (f x + e\right ) + 1\right ) - \log \left (\cos \left (f x + e\right ) - 1\right )\right )} + \frac {2 \, a}{\tan \left (f x + e\right )}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*sin(f*x+e)),x, algorithm="maxima")

[Out]

-1/2*(b*(log(cos(f*x + e) + 1) - log(cos(f*x + e) - 1)) + 2*a/tan(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 6.76, size = 28, normalized size = 1.08 \[ \frac {b\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{f}-\frac {a\,\mathrm {cot}\left (e+f\,x\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sin(e + f*x))/sin(e + f*x)^2,x)

[Out]

(b*log(tan(e/2 + (f*x)/2)))/f - (a*cot(e + f*x))/f

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sin {\left (e + f x \right )}\right ) \csc ^{2}{\left (e + f x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**2*(a+b*sin(f*x+e)),x)

[Out]

Integral((a + b*sin(e + f*x))*csc(e + f*x)**2, x)

________________________________________________________________________________________